import request from '@/utils/request'
/** *
 * 获取组织架构数据
 * **/
export function reqDepartments() {
  return request({
    url: '/company/department'
  })
}
/**
 * 根据id删除部门
 */
export const reqDelDepartments = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
// 新增部门接口
export const reqAddDepartments = (data) => {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
/** *
 * 获取部门详情
 * ***/
export function reqGetDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
/**
 * 编辑部门详情
 */
export const reqUpdateDepartments = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
